import request from '@/utils/request'
import store from '@/store'

// 封装登录的请求接口
export const loginAPI = data => {
  return request({
    url: '/v1_0/authorizations',
    method: 'post',
    data
  })
}

// 封装获取用户信息的接口
export const userInfoAPI = () => {
  return request({
    url: '/v1_0/user/profile',
    method: 'get'
  })
}

// 封装修改头像的接口
export const avatarAPI = data => {
  return request({
    url: '/v1_0/user/photo',
    method: 'patch',
    data
  })
}

// 封装修改资料的接口
export const editUserAPI = data => {
  return request({
    url: '/v1_0/user/profile',
    method: 'patch',
    data
  })
}
